﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace Xmlparsing.Controls
{
    public class XmlServerControl : WebControl
    {
        public XmlServerControl()
            : base("div")
        {
        }

        public string To { get; set; }
        public string From { get; set; }
        public string Title { get; set; }
        public string Body { get; set; }

        protected override void RenderContents(System.Web.UI.HtmlTextWriter writer)
        {
            writer.Write("<div class='message'>");
            writer.Write("To: <span class='to'>"+To+"</span>");
            writer.Write("From: <span class='from'>" + From + "</span>");
            writer.Write("<div>Title: <span class='title'>" + Title + "</span></div>");
            writer.Write("<div class='body'>Body: " + Body + "</div>");
            writer.Write("</div>");
        }

    }
}